package com.gitee.wsl.compose.ui.navigation

import androidx.compose.animation.AnimatedVisibilityScope
import androidx.compose.runtime.Composable
import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController


interface NavDestinationScope<Args: NavArgumentKey>: AnimatedVisibilityScope {
    fun navArgs(): NavArgs<Args>
}

/**
 * Internal NavDestinationScope impl.
 */
internal open class NavDestinationScopeImpl<Args: NavArgumentKey>(
    private val navDestination: NavDestination<Args>,
    private val backStackEntry: NavBackStackEntry,
    private val animatedVisibilityScope: AnimatedVisibilityScope
) : NavDestinationScope<Args>, AnimatedVisibilityScope by animatedVisibilityScope{
    override fun navArgs(): NavArgs<Args> = navDestination.navArgs(backStackEntry)
}

/**
 * @return The current [NavController].
 */
//@Composable
//@Suppress("UnusedReceiverParameter")
//fun NavDestinationScope<*>.navController(vararg navigators: Navigator<out NavDestination>): NavController = rememberNavController(*navigators)
    //LocalNavController.current ?: error("not attached to navController")
